import React, { FC } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { Button } from 'antd';
import _ from 'lodash';
import BasicTop from './basicTop';
import BasicBody from './basicBody';

// eslint-disable-next-line react/require-default-props
const Groups: FC<{ title?: string; isEdit?: boolean; buttonList: React.ReactNode[] }> = ({
  title = '基本信息',
  isEdit = true,
  buttonList = [],
}) => {
  const navigate = useNavigate();
  const params = useParams();
  let topCntForm;
  let topPhotoForm;

  const buildBtns = () => {
    return isEdit ? [<Button type="primary">保存</Button>] : buttonList;
  };

  return (
    <>
      <BasicTop
        onLoad={(form1, form2) => {
          topCntForm = form1;
          topPhotoForm = form2;
        }}
        isEdit={isEdit}/>
      <BasicBody isEdit={isEdit} />
    </>
  );
};

export default Groups;
